<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>
    function getAge() {
        // 今年 - 出生的年
        let now = new Date().getFullYear();
        return now - this.birth;
    }

    let chen = {
        name: "2233",
        birth: 2000,
        age: getAge
    };

    let xiaoMing = {
        name: "2233",
        birth: 2020,
        age: getAge
    };

    console.log(chen.name);
    console.log(chen.age());

    console.log(getAge.apply(xiaoMing, []));
</script>

</body>
</html>